<?php
// 检查是否已登录
require_once 'auth.php';

// 如果用户已登录，重定向到仪表盘
if (isLoggedIn()) {
    header('Location: dashboard.php');
    exit;
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>仓库管理系统 - 首页</title>
    <link rel="stylesheet" href="/dist/css/tabler.min.css">
    <!--favicon-->
    <link rel="icon" href="/favicon.ico">   
    <style>
        .hero-section {
            padding: 4rem 0;
            background-color: #f8f9fa;
        }
        .feature-card {
            transition: transform 0.3s ease;
        }
        .feature-card:hover {
            transform: translateY(-5px);
        }
    </style>
</head>
<body>
    <header class="navbar navbar-expand-md navbar-dark bg-primary">
        <div class="container">
            <a href="index.php" class="navbar-brand">仓库管理系统</a>
            <div class="ms-auto">
                <a href="login.php" class="btn btn-light">登录系统</a>
            </div>
        </div>
    </header>

    <main class="hero-section">
        <div class="container">
            <div class="row justify-content-center text-center mb-5">
                <div class="col-md-8">
                    <h1 class="display-4 mb-3">高效仓库管理解决方案</h1>
                    <p class="lead text-muted">简化库存跟踪、出入库管理和操作记录，提升仓库运营效率</p>
                    <a href="login.php" class="btn btn-primary btn-lg mt-3">立即开始使用</a>
                </div>
            </div>

            <div class="row mt-5">
                <div class="col-md-4">
                    <div class="card feature-card h-100">
                        <div class="card-body text-center">
                            <div class="icon icon-lg bg-primary text-white rounded-circle mb-3 d-inline-flex align-items-center justify-content-center">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
                            </div>
                            <h3 class="card-title">库存管理</h3>
                            <p class="card-text">实时跟踪库存数量、位置和状态，避免缺货或积压</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="card feature-card h-100">
                        <div class="card-body text-center">
                            <div class="icon icon-lg bg-success text-white rounded-circle mb-3 d-inline-flex align-items-center justify-content-center">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.29 7 12 12 20.71 7"></polyline><line x1="12" y1="22" x2="12" y2="12"></line></svg>
                            </div>
                            <h3 class="card-title">出入库管理</h3>
                            <p class="card-text">标准化出入库流程，记录详细操作信息，确保数据准确</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="card feature-card h-100">
                        <div class="card-body text-center">
                            <div class="icon icon-lg bg-info text-white rounded-circle mb-3 d-inline-flex align-items-center justify-content-center">
                                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>
                            </div>
                            <h3 class="card-title">操作日志</h3>
                            <p class="card-text">完整记录所有系统操作，支持审计追踪和责任追溯</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <footer class="bg-dark text-white py-4 mt-5">
        <div class="container text-center">
            <p>© <?php echo date('Y'); ?> 仓库管理系统 - 提升您的仓储管理效率</p>
        </div>
    </footer>

    <script src="/dist/js/tabler.min.js"></script>
</body>
</html>